const mongoose = require("mongoose");
module.exports = new Promise((reslove, reject) => {
    mongoose.connect("mongodb://localhost:27017/meifa.demo", {
        useNewUrlParser: true,
        useUnifiedTopology: true
    });
    mongoose.connection.once('open', err => {
        if (!err) {
            console.log("数据库连接成功！！");
            reslove();
        } else {
            console.log(err);
            reject();
        }
    })
})